package cn.tongdun.atreus.common.log;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;



import java.util.List;

/**
 * @author wangze
 * @date 2021-10-20 16:33.
 **/
@Component
public class JdbcService {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	/**
	 * 返回配置类
	 * @return
	 */
	public List<LogConfig> selectConfigList() {
		String sql = "select field,rule from admin_log ";
		return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(LogConfig.class));
	}
}
